# -*- encoding: utf-8 -*-
"""

PyCharm 04实现调用的函数传入参数和装饰器也传入函数
2024年10月21日19时26分
by wenyang

文件主要内容:


"""
def outer(times: int):
    count = 0
    def inner(function):
        def wrapper(*args, **kwargs):
            nonlocal count
            for _ in range(times):
                count += 1
                print(f"第{count}次执行".center(50, "*"))
                result = function(*args, **kwargs)
                print("函数执行结束".center(50, "-"))
            return result
        return wrapper
    return inner
@outer(3)
def add(a, b, *args):
    return a * b + sum(args)


def main():
    print(add(3, 5, *[23, 34, 5, 5]))


if __name__ == "__main__":
    main()
